package wortubung.inflection;

import wortubung.core.LANG;

public enum DECLENSION {
              // de         la
	Nominative("Nominativ", ""),
	Accusative("Akkusativ", ""),
	Dative    ("Dativ",     ""),
	Genitive  ("Genitiv",   ""),
	Ablative  ("Ablativ",   ""),
	Vocative  ("Vokativ",   "");

	private String[] indigenousNames;

	private DECLENSION(String... indigenousNames) {
		this.indigenousNames = indigenousNames;
	}

	private static int getLangIndex(LANG lang) {
		switch(lang) {
		case de: return 0;
		case la: return 1;
		default: return -1;
		}
	}

	public String getDisplay(LANG lang, boolean longForm) {
		String ret = indigenousNames[getLangIndex(lang)];
		if (!longForm)
			ret = ret.substring(0, 3) + '.';
		return ret;
	}

	public static DECLENSION[] values(LANG lang) {
		switch(lang) {
		case de: return new DECLENSION[]{ Nominative, Genitive, Dative, Accusative };
		case la: return values();
		default: return null;
		}
	}
}
